
Bro = Browser;
Browser.log = function(message) {
	if (!this.logger) {
		if(!this.loggers) {
			throw "no loggers registered!";
		}
		var engine = Browser.Engine.name;
		if (!this.loggers[engine]) {
			engine = 'uni';
		}
		var lg = this.loggers[engine];
		this.logger = new lg();
	}
	this.logger.put(message);
};

Browser.addLogger = function(name, logger) {
	if (!this.loggers) this.loggers = {};
	this.loggers[name] = logger;
}

Browser.addLogger('gecko', Class({
		put: function(message) {
			if (!window.console) return;
			console.log(message);
		}
	})
);

Browser.addLogger('trident', Class({
		put: function(message) {
			if (!window.console) return;
			console.log(message);
		}
	})
);

Browser.addLogger('presto', Class({
	put: function(message) {
		opera.postError(message);
	}
}));

Browser.addLogger('webkit', Class({
	put: function(message) {
		console.warn(message);
	}	
}));

Browser.addLogger('uni', Class({
		put: function(message) {
			if (window.firebug) {
				if (window.firebug.d) firebug.d.console.cmd.log(message);
			} else alert(message);
		}
	})
);
